using System;
using System.Collections.Generic;
using System.Text;

namespace Fanfou.Entity
{
    /// <summary>
    /// A fanfou.com account/profile.
    /// </summary>
    [Serializable]
    public class User
    {
        private readonly string _id, _screenName, _name, _location, _description;
        private readonly string _profileImage, _url;
        private readonly bool _isProtected;
        private readonly int _friendsCount, _followersCount, _favouritesCount, _messagesCount, _utcOffset;

        #region Properties

        /// <summary>
        /// The last word of the your fanfou.com personal page URL.
        /// For example: In URL http://fanfou.com/shiny, shiny is the Id.
        /// </summary>
        public string Id
        {
            get { return _id; }
        }

        /// <summary>
        /// The screenname of your fanfou.com profile.
        /// </summary>
        public string ScreenName
        {
            get { return _screenName; }
        }

        /// <summary>
        /// The name of your fanfou.com profile.
        /// </summary>
        public string Name
        {
            get { return _name; }
        }

        /// <summary>
        /// The location of your fanfou.com profile.
        /// </summary>
        public string Location
        {
            get { return _location; }
        }

        /// <summary>
        /// The description of your fanfou.com profile.
        /// </summary>
        public string Description
        {
            get { return _description; }
        }

        /// <summary>
        /// The profile image url of your fanfou.com profile.
        /// </summary>
        public string Image
        {
            get { return _profileImage; }
        }

        /// <summary>
        /// Your personal page on fanfou.com.
        /// </summary>
        public string Url
        {
            get { return _url; }
        }

        /// <summary>
        /// Whether your account is protected.
        /// </summary>
        public bool IsProtected
        {
            get { return _isProtected; }
        }

        /// <summary>
        /// The amount of your friends.
        /// </summary>
        public int FriendsCount
        {
            get { return _friendsCount; }
        }

        /// <summary>
        /// The amount of your followers.
        /// </summary>
        public int FollowersCount
        {
            get { return _followersCount; }
        }

        /// <summary>
        /// The amount of your favourites.
        /// </summary>
        public int FavouritesCount
        {
            get { return _favouritesCount; }
        }

        /// <summary>
        /// The amount of your messages(statuses).
        /// </summary>
        public int MessagesCount
        {
            get { return _messagesCount; }
        }

        /// <summary>
        /// UTC Offest
        /// </summary>
        public int UtcOffset
        {
            get { return _utcOffset; }
        }

        #endregion

        /// <summary>
        /// Create a User
        /// </summary>
        /// <param name="screenname"></param>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="location"></param>
        /// <param name="description"></param>
        /// <param name="image"></param>
        /// <param name="url"></param>
        /// <param name="isProtected"></param>
        /// <param name="friendsCount"></param>
        /// <param name="followersCount"></param>
        /// <param name="favouritesCount"></param>
        /// <param name="messagesCount"></param>
        /// <param name="utcOffset"></param>
        public User(string screenname, string id, string name, string location, string description, string image, string url, bool isProtected, int friendsCount, int followersCount, int favouritesCount, int messagesCount, int utcOffset)
        {
            _screenName = screenname;
            _id = id;
            _name = name;
            _location = location;
            _description = description;
            _profileImage = image;
            _url = url;
            _isProtected = IsProtected;
            _friendsCount = friendsCount;
            _followersCount = followersCount;
            _favouritesCount = favouritesCount;
            _messagesCount = messagesCount;
            _utcOffset = utcOffset;
        }

        /// <summary>
        /// Retrieve a user from friend modle.
        /// </summary>
        /// <param name="screenname"></param>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="location"></param>
        /// <param name="description"></param>
        /// <param name="image"></param>
        /// <param name="url"></param>
        /// <param name="isProtected"></param>
        public User(string screenname, string id, string name, string location, string description, string image, string url, bool isProtected)
            : this(screenname, id, name, location, description, image, url, isProtected, 0, 0, 0, 0, 0)
        {
        }
    }
}
